package com.heima.wemedia.controller.v1;


import com.baomidou.mybatisplus.extension.api.R;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsDto;
import com.heima.model.wemedia.dtos.WmNewsPageReqDto;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.wemedia.service.IWmNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 自媒体图文内容信息表 前端控制器
 * </p>
 *
 * @author lcz
 * @since 2024-11-20
 */
@RestController
@RequestMapping("/api/v1/news")
public class WmNewsController {


    @Autowired
    private IWmNewsService iWmNewsService;

    @PostMapping("/list")
    public ResponseResult newList(@RequestBody WmNewsPageReqDto dto) {
      return iWmNewsService.querylist(dto);

    }

    @PostMapping("/submit")
    public ResponseResult submit(@RequestBody WmNewsDto dto){
        return iWmNewsService.submit(dto);
    }

    /**
     * 更具kafuk修改app端的状态
     */
    @PostMapping("/down_or_up")
    public ResponseResult  changeStatus(@RequestBody WmNewsDto wmNewsDto){
        return iWmNewsService.changeStatus(wmNewsDto);
    }

}
